package com.magicsoft.share.adapter.my;

import android.graphics.Paint;
import android.support.annotation.LayoutRes;
import android.widget.TextView;

import com.bumptech.glide.Glide;
import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.magicsoft.share.R;
import com.magicsoft.share.bean.my.MessageList;
import com.makeramen.roundedimageview.RoundedImageView;

/**
 * Created by lyf on 2017/11/8/008.
 */

public class CommentAdapter extends BaseQuickAdapter<MessageList.ListBean, BaseViewHolder> {

    public CommentAdapter(@LayoutRes int layoutResId) {
        super(layoutResId);
    }

    @Override
    protected void convert(BaseViewHolder helper, MessageList.ListBean item) {
        RoundedImageView iv_head = helper.getView(R.id.iv_head);
        Glide.with(mContext).load(item.getHeadimg()).into(iv_head);
        helper.setText(R.id.tv_name, item.getNickname())
                .setText(R.id.tv_date, item.getCreateTime())
                .setText(R.id.tv_article_title, item.getTitle())
                .setText(R.id.tv_comment, item.getContent());
        TextView tv_title = helper.getView(R.id.tv_article_title);
        tv_title.getPaint().setFlags(Paint.FAKE_BOLD_TEXT_FLAG);
    }
}
